const router = require('koa-router')()
let url = 'http://172.25.38.252:3000'
// 创建订单
router.post('/', function (ctx,next){
    let data = ctx.request.body    //获取请求提内容
    ctx.body =  {
        msg:'添加到订单',
        data:data
    }    //
})


// 用户订单
router.get('/', function (ctx,next){
    ctx.body=[
        { title:'订单商品1', price:70, start:1, number:1, size:'m',fm:`${url}/goods1.png`},
        { title:'订单商品2', price:45,start:2, number:1, size:'m', fm:`${url}/goods2.png`},
        { title:'订单商品3', price:65, start:2, number:1, size:'m',fm:`${url}/goods3.png`},
        { title:'订单商品4', price:14,start:3, number:1, size:'m', fm:`${url}/goods2.png`}
    ]
})


module.exports = router
